package com.suep.teacher_manage.repository;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suep.teacher_manage.model.Teacher;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface TeacherRepository extends BaseMapper<Teacher> {
    @Select("select * from Teacher where ${ew.SQLSegment}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
            @Result(property = "institution", column = "institution"),
            @Result(property = "department", column = "department"),
            @Result(property = "title", column = "title"),
            @Result(property = "gender", column = "gender"),
            @Result(property = "age", column = "age"),
            @Result(property = "phone", column = "phone"),
            @Result(property = "email", column = "email")
    })
    List<Teacher> selectByid(@Param("ew") Wrapper<Teacher> queryWrapper);
    @Select("select * from Teacher")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
            @Result(property = "institution", column = "institution"),
            @Result(property = "department", column = "department"),
            @Result(property = "title", column = "title"),
            @Result(property = "gender", column = "gender"),
            @Result(property = "age", column = "age"),
            @Result(property = "phone", column = "phone"),
            @Result(property = "email", column = "email")
    })
    List<Teacher> selectAll();

}
